# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Content.V21.Model.Segments do
  @moduledoc """
  Dimensions according to which metrics are segmented in the response. Values of product dimensions, such as `offer_id`, reflect the state of a product at the time of the corresponding event, for example, impression or order. Segment fields cannot be selected in queries without also selecting at least one metric field. Values are only set for dimensions requested explicitly in the request's search query.

  ## Attributes

  *   `brand` (*type:* `String.t`, *default:* `nil`) - Brand of the product.
  *   `categoryL1` (*type:* `String.t`, *default:* `nil`) - [Product category (1st level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in Google's product taxonomy.
  *   `categoryL2` (*type:* `String.t`, *default:* `nil`) - [Product category (2nd level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in Google's product taxonomy.
  *   `categoryL3` (*type:* `String.t`, *default:* `nil`) - [Product category (3rd level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in Google's product taxonomy.
  *   `categoryL4` (*type:* `String.t`, *default:* `nil`) - [Product category (4th level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in Google's product taxonomy.
  *   `categoryL5` (*type:* `String.t`, *default:* `nil`) - [Product category (5th level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in Google's product taxonomy.
  *   `currencyCode` (*type:* `String.t`, *default:* `nil`) - Currency in which price metrics are represented, for example, if you select `ordered_item_sales_micros`, the returned value will be represented by this currency.
  *   `customLabel0` (*type:* `String.t`, *default:* `nil`) - Custom label 0 for custom grouping of products.
  *   `customLabel1` (*type:* `String.t`, *default:* `nil`) - Custom label 1 for custom grouping of products.
  *   `customLabel2` (*type:* `String.t`, *default:* `nil`) - Custom label 2 for custom grouping of products.
  *   `customLabel3` (*type:* `String.t`, *default:* `nil`) - Custom label 3 for custom grouping of products.
  *   `customLabel4` (*type:* `String.t`, *default:* `nil`) - Custom label 4 for custom grouping of products.
  *   `customerCountryCode` (*type:* `String.t`, *default:* `nil`) - Code of the country where the customer is located at the time of the event. Represented in the ISO 3166 format. If the customer country cannot be determined, a special 'ZZ' code is returned.
  *   `date` (*type:* `GoogleApi.Content.V21.Model.Date.t`, *default:* `nil`) - Date in the merchant timezone to which metrics apply.
  *   `offerId` (*type:* `String.t`, *default:* `nil`) - Merchant-provided id of the product.
  *   `productTypeL1` (*type:* `String.t`, *default:* `nil`) - [Product type (1st level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in merchant's own product taxonomy.
  *   `productTypeL2` (*type:* `String.t`, *default:* `nil`) - [Product type (2nd level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in merchant's own product taxonomy.
  *   `productTypeL3` (*type:* `String.t`, *default:* `nil`) - [Product type (3rd level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in merchant's own product taxonomy.
  *   `productTypeL4` (*type:* `String.t`, *default:* `nil`) - [Product type (4th level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in merchant's own product taxonomy.
  *   `productTypeL5` (*type:* `String.t`, *default:* `nil`) - [Product type (5th level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in merchant's own product taxonomy.
  *   `program` (*type:* `String.t`, *default:* `nil`) - Program to which metrics apply, for example, Free Product Listing.
  *   `title` (*type:* `String.t`, *default:* `nil`) - Title of the product.
  *   `week` (*type:* `GoogleApi.Content.V21.Model.Date.t`, *default:* `nil`) - First day of the week (Monday) of the metrics date in the merchant timezone.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :brand => String.t() | nil,
          :categoryL1 => String.t() | nil,
          :categoryL2 => String.t() | nil,
          :categoryL3 => String.t() | nil,
          :categoryL4 => String.t() | nil,
          :categoryL5 => String.t() | nil,
          :currencyCode => String.t() | nil,
          :customLabel0 => String.t() | nil,
          :customLabel1 => String.t() | nil,
          :customLabel2 => String.t() | nil,
          :customLabel3 => String.t() | nil,
          :customLabel4 => String.t() | nil,
          :customerCountryCode => String.t() | nil,
          :date => GoogleApi.Content.V21.Model.Date.t() | nil,
          :offerId => String.t() | nil,
          :productTypeL1 => String.t() | nil,
          :productTypeL2 => String.t() | nil,
          :productTypeL3 => String.t() | nil,
          :productTypeL4 => String.t() | nil,
          :productTypeL5 => String.t() | nil,
          :program => String.t() | nil,
          :title => String.t() | nil,
          :week => GoogleApi.Content.V21.Model.Date.t() | nil
        }

  field(:brand)
  field(:categoryL1)
  field(:categoryL2)
  field(:categoryL3)
  field(:categoryL4)
  field(:categoryL5)
  field(:currencyCode)
  field(:customLabel0)
  field(:customLabel1)
  field(:customLabel2)
  field(:customLabel3)
  field(:customLabel4)
  field(:customerCountryCode)
  field(:date, as: GoogleApi.Content.V21.Model.Date)
  field(:offerId)
  field(:productTypeL1)
  field(:productTypeL2)
  field(:productTypeL3)
  field(:productTypeL4)
  field(:productTypeL5)
  field(:program)
  field(:title)
  field(:week, as: GoogleApi.Content.V21.Model.Date)
end

defimpl Poison.Decoder, for: GoogleApi.Content.V21.Model.Segments do
  def decode(value, options) do
    GoogleApi.Content.V21.Model.Segments.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Content.V21.Model.Segments do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
